<template>
	<div id="user">
		<van-nav-bar
		  title="个人中心"
		  left-text="返回"
		  left-arrow
		  @click-left="onClickLeft"
		/>
		<van-image
		  round
		  width="5rem"
		  height="5rem"
		  margin="0 auto"
		  src="https://img01.yzcdn.cn/vant/cat.jpeg"
		/>
		<van-cell-group>
		  <van-cell title="尊贵的VIP用户" :value="username" />
		</van-cell-group>
		<van-cell title="我的订单" is-link to="/user" style="margin-top: 1rem;margin-bottom: 1rem;" />
		<van-grid>
		  <van-grid-item icon="photo-o" text="文字" />
		  <van-grid-item icon="photo-o" text="文字" />
		  <van-grid-item icon="photo-o" text="文字" />
		  <van-grid-item icon="photo-o" text="文字" />
		</van-grid>
	</div>
</template>

<script>
	import { Toast } from 'vant';
	export default {
		name:'user',
		data(){
			return {
				txt:'123',
				username:''
			}
		},
	  methods: {
	    onClickLeft() {
	      Toast('返回');
		  this.$axios({
			  url:'/api/xjr/user',
		  }).then(res=>{
			  console.log(this.$route)
		  })
	    },
	  },
	  created(){
	  },
	  mounted(){
		this.username  =  JSON.parse(window.localStorage.getItem('user')) ? JSON.parse(window.localStorage.getItem('user')).data.nikename : "系统出错"
	  }
	};
</script>

<style>
	.app{
		background-color:#f2f2f2 ;
	}
	.van-image {
		width: 5rem;
		margin: 0px auto;
		display: block;
		height: 5rem;
	}
</style>
